package oracle.springbootxm.config;

import java.io.FileWriter;
import java.io.IOException;

/* *
 *类名：AlipayConfig
 *功能：基础配置类
 *详细：设置帐户有关信息及返回路径
 *修改日期：2017-04-05
 *说明：
 *以下代码只是为了方便商户测试而提供的样例代码，商户可以根据自己网站的需要，按照技术文档编写,并非一定要使用该代码。
 *该代码仅供学习和研究支付宝接口使用，只是提供一个参考。
 */

public class AlipayConfig {

//↓↓↓↓↓↓↓↓↓↓请在这里配置您的基本信息↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓

    // 应用ID,您的APPID，收款账号既是您的APPID对应支付宝账号
    public static String app_id = "2021000117636257";

    // 商户私钥，您的PKCS8格式RSA2私钥
    public static String merchant_private_key = "MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCNikfaKb7U7yyBBZRRIa5e5asocm4086G0C1bJPxB+7jIAP25bZBJFCBMJWWXNxEPUg/m0mTUgiNSoRr3JRG/OW1Zyb0v2syhfzWgf0Xi9K4nIg56XDj+bVWfBujXDeySvo2kqxVbdgDIKafHAjFHiyU1oDecXRqZ9MCVrW7LBWqmFKDq1jDWQhTUHH5viYBcsUg6AeDOw7zPguyGV2MLuzfKvS7k5aEByLtE6A79nNsTNXGjwLvbvsUrQmXwTLpAFVTWE6dwTw26WiV4/w1fezYed58KOSsYgpfc063ez9JqJScHbbbZAwntPYuPmElxfAKUzP6jR9pkjf1QCpC/zAgMBAAECggEACMtWu49sc/6IXVvjY0ccdnj+sXyqrE+W9IDf25E3jStvn+RRDwygtflSdXpAgRB4xnOMyFPcoTDfRbVfhWnjKIc0T9fqeGGZWJqCpbd2MQrLfNHwwKH6AcTEtZzESmkUVnVoy2eHhiu48Dy08KnHTLgFPznd6exR2+Vp7cm8yZaowCK5D/PI9Snsy9AUObz/wqrwBXuSM+iwbYNMg+33DdVBu6QKRzo7wHrOfv+dWtxsGQiHIYw0yTnRl9mH2pOPrPOTZ+lprKfwZoFJRu++806UYQi+GDuDEJ9R6eOUpONKWc1I92wbwwhfXJ0mQKRSe2X6nnyshaIOH4KKI1yCQQKBgQDQ1t4JvSjrHtP+/Dfy2PcFIyyy4kbgd/D/naosfnfBL4QtU9sKpGn8LZljnG5NvbxIfDs1/R142vR4ep6Gpf8bGwchibOy7cjBJb1JrhdX705egRBfGO6VcWDeySaI+OzaNYB8IiNoR/X0VVeYV+guDKY1LJ96+y/lYGbrft5QDQKBgQCtgM5kGkiT0JFm+H4J/cQCdx8nSPgCR+ZLAfOosR/waIKhl25MTUqG/UGAHHH2yY4qfxwowpNbigMOlah+eQqZmSBJk83zdFZmHrX24ZN8+jbBh6WmysKVhF6WFOq+69H725rTwwe3JEufTsIwCDgRKxgsWagJe1RMDn7n5Gx//wKBgBs9K1DR31hrePM1Kob+TZnZ8KaUZPI6MrDke6G6DRyheff/i/5jW3+M4wjfCnQRX1GFAqQUE5gD1wcv1yVw2UlLyS5Sq6GW6ixnI71Me7b4e5xP8Ta2JchQNXZZfjE3Zo0/lTabrUqYuDfaOcahEKOQ+szMuTBtOt4MKOBmd9CxAoGACqJ3hBk8U5sYHniiuRgN2JzWkwDc+r7Pdc+D0NYyf/jX8PGoOBMQu19wkVqs/ZRzG1W5MyJiB91YvJ8ducrPhISnPvtJR1/dH9tICf7fnGx1yLz4wVVyQdngNlDH5rXrpAVc4xf0NByMahJYwrruPNcoXyeLrjEaBKNq0enlYJ8CgYEAtW6cfDB8FoKl2tefg+VFzf9cy2LmOVDJubGg/G3nb2qbeHdfubah73SHV/xWRYzPV02C2JnMe/b9QgaCZXrOAy8EwEv85V1XbxEsWoSEuC1cRdsZnpJy1hYtbAzaq9pDbItSnHsz5fkTANiLr1MIxYUGFXUKtbut76i7DNl9AnM=";

    // 支付宝公钥,查看地址：https://openhome.alipay.com/platform/keyManage.htm 对应APPID下的支付宝公钥。
    public static String alipay_public_key = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAiRw6Y73BTUagtt036ZZpyKgktLv1XPck4aID+AFcGfhro1TqBwl7ajVlI9uM7IlFht7F/cXAi5MPP5pKDXa3ZvETR7QlHeDplNTAxZbWyylxHhWiHHEtcIVflkaWc+6jW+Rzzwg4vxw3W355HE+etdisRxlal0/pcYuKAwtPk8zobfXpPq0O8ytjIkpnz+4kJAuOWwRytZs/+FZZNdeFC4y+nZnxDaUhxEr/bYvx4HslUC6zsM6Iwje/4IFqBZzMFljCJNgPWv54Fden77lF4yuOr++87qzYvSS1fysylrKfbhFYp0IdU1LokN485TzwAiLeZjpxfLhdnrDc4NmStQIDAQAB";

    // 服务器异步通知页面路径  需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    public static String notify_url = "http://m4tt48.natappfree.cc/notify_url.jsp";

    // 页面跳转同步通知页面路径 需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    public static String return_url = "http://m4tt48.natappfree.cc/return_url.jsp";

    // 签名方式
    public static String sign_type = "RSA2";

    // 字符编码格式
    public static String charset = "utf-8";

    // 支付宝网关
    public static String gatewayUrl = "https://openapi.alipaydev.com/gateway.do";

    // 支付宝网关
    public static String log_path = "D:\\";


//↑↑↑↑↑↑↑↑↑↑请在这里配置您的基本信息↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

    /**
     * 写日志，方便测试（看网站需求，也可以改成把记录存入数据库）
     *
     * @param sWord 要写入日志里的文本内容
     */
    public static void logResult(String sWord) {
        FileWriter writer = null;
        try {
            writer = new FileWriter(log_path + "alipay_log_" + System.currentTimeMillis() + ".txt");
            writer.write(sWord);
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if (writer != null) {
                try {
                    writer.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }
}
